import { request } from "../network/request";

export function addClass({ title, tip, area, time, teacher }) {
  return request({
    url: "/addClass",
    method: "POST",
    data: {
      title: title,
      tip: tip,
      area: area,
      time: time,
      teacher: teacher,
    },
  });
}

export function delClass({ id }) {
  return request({
    url: "/delClass",
    method: "POST",
    data: {
      _id: id,
    },
  });
}

export function getClass() {
  return request({
    url: "/getClass",
    method: "GET",
  });
}

export function editClass({ title, tip, area, time, teacher, _id }) {
  console.log(_id);
  return request({
    url: "/editClass",
    method: "POST",
    data: {
      title: title,
      tip: tip,
      area: area,
      time: time,
      teacher: teacher,
      _id: _id,
    },
  });
}
